package test3;

public class Demo2 {
}

class Food{

    //重量
    public double weight;

    public Food(double weight){
        this.weight = weight;
    }
}
class Fruits extends Food{

    //甜度
    public String sweetness;

    //花期
    public String florescence;

    //单参
    public Fruits(String sweetness,double weight){
        super(weight);
        this.sweetness = sweetness;
    }
    //多参
    public Fruits(String sweetness,String florescence,double weight){
        this(sweetness,weight);
        this.florescence = florescence;
    }
}
